﻿using FySystem.Job;
using FySystem.Job.JobTask;
using System;

namespace JobTest
{
    internal class Program
    {
        static void Main(string[] args)
        {
            //IntervalJob job = new IntervalJob("测试", RunJob, 1);
            //FyJobContext.AddJob(job);

            //TimerJob timerJob = new TimerJob("测试", RunJob,
            //    null,
            //    null,
            //    second =>
            //    {
            //        return second % 5 == 0;
            //    });
            //FyJobContext.AddJob(timerJob);

            DailyJob dailyJob = new DailyJob("测试", RunJob, 14, 19, 0);
            FyJobContext.AddJob(dailyJob);

            FyJobContext.Run();

            while (true)
                Console.ReadKey();
        }

        private static void RunJob(DateTime currTime)
        {
            Console.WriteLine(currTime.ToString());
        }
    }
}
